package org.traffometer.packet;

/**
 * Implements a vehicle representation, which is a larger representation than VehicleType. A
 * vehicle representation contains a VehicleType. The VehicleType determines whether the other
 * values within this representation are optional. For example a bus will have a Bus VehicleType
 * and the name and uniqueIdent of the bus Vehicle object is required. This means that all buses
 * in our system must be fully identifiable. On the other hand, a Vehicle with an Anonymous 
 * VehicleType will not have any identifiable markings; i.e. no name or uniqueIdent. 
 * <p>
 * Note that the contents of the name and uniqueIdent is not known.
 * 
 * @author Aaron A. Kagawa
 * @version $Id$
 */
public class Vehicle {
  
  private VehicleType vehicleType; 
  private String name;
  private String uniqueIdent;

  /**
   * Constructs a Vehicle object with the specified parameters. This constructor requires 
   *   valid values for all parameters.  
   * @param vehicleType The type of the vehicle.
   * @param name The name of the vehicle.
   * @param uniqueIdent The unique identifier of the vehicle.
   */
  public Vehicle(VehicleType vehicleType, String name, String uniqueIdent) {
    this.vehicleType = vehicleType;
    this.name = name;
    this.uniqueIdent = uniqueIdent;
  }
  
  /**
   * Returns the VehicleType of the vehicle.
   * @return The VehicleType.
   */
  public VehicleType getVehicleType() {
    return this.vehicleType;
  }
  
  /**
   * Returns the name of the vehicle. This value can be null if the name is not required. See
   *   the class level documentation for the rules of requirements.
   * @return The name of the vehicle or null depending on the VehicleType.
   */
  public String getName() {
    return this.name;
  }

  /**
   * Returns the unique identifier of the vehicle. This value can be null if the unique identifier 
   *   is not required. See the class level documentation for the rules of requirements.
   * @return The unique identifier of the vehicle or null depending on the VehicleType.
   */
  public String getUniqueIdent() {
    return this.uniqueIdent;
  }
}
